CentOS 6
Sponsored Link

FreeIPA Authentication
2013/01/28
 
Configure httpd and set a page that people must authenticate with FreeIPA Server. Therefore it's necessarry to run FreeIPA Server in your LAN.
[1] First, add HTTP service like follows on the FreeIPA Server.
# how to write ⇒ ipa service-add HTTP/(your web server)

[root@master ~]#
ipa service-add HTTP/www.srv.world

--------------------------------------------------
Added service "HTTP/www.srv.world@SERVER.WORLD"
--------------------------------------------------
  Principal: HTTP/www.srv.world@SERVER.WORLD
  Managed by: www.srv.world
[2] Configure on the Web Server. For example, create a directory "ipa" and it requires authentication with IPA Server.
# install some packgaes first

[root@www ~]#
yum -y install mod_auth_kerb
[root@www ~]#
kinit admin

Password for admin@SERVER.WORLD:
# IPA admin password
# generate Keytab

[root@www ~]#
ipa-getkeytab -s master.srv.world -p HTTP/www.srv.world -k /etc/httpd/conf.d/keytab

Keytab successfully retrieved and stored in: /etc/httpd/conf.d/keytab
[root@www ~]#
chown apache. /etc/httpd/conf.d/keytab
[root@www ~]#
vi /etc/httpd/conf.d/auth_ipa.conf
# create new

<Directory /var/www/html/ipa>
    SSLRequireSSL
    AuthName "IPA Authentication"
    AuthType Kerberos

    KrbServiceName HTTP
    KrbMethodK5Passwd On
    KrbSaveCredentials On
    KrbMethodNegotiate On
    KrbAuthRealms SERVER.WORLD
    Krb5KeyTab /etc/httpd/conf.d/keytab

    AuthLDAPUrl ldap://master.srv.world/dc=server,dc=world?krbPrincipalName
    Require valid-user
</Directory>

[root@www ~]#
/etc/rc.d/init.d/httpd restart
[root@www ~]#
vi /var/www/html/ipa/index.html
# create a test page

<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Test Page for IPA Server Auth
</div>
</body>
</html>
  Access to the test page with web browser, then authentication is required as a config. Input a FreeIPA user and authenticate here.
  Just accessed.
 
Tweet